package com.dongge.service;

import com.dongge.dao.InfoDao;
import com.dongge.entity.Info;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2015/10/15.
 */
@Service
public class InfoService {

    @Resource
    private InfoDao infoDao;


    public void saveOrUpdate(Info info){
        infoDao.saveOrUpdate(info);
    }

    public List<Info> getList(){
        return infoDao.getInfoList();
    }

    public void delete(Integer id){
        Info info = infoDao.get(id);
        if(info ==null){
            return;
        }
        infoDao.delete(info);
    }

    public Info get(Integer id){
        return infoDao.get(id);
    }
}
